import store from '../../../store/store.js'
import * as ActionTypes from '../../../constants/constants.js'
import { isUser, isWxUser, path, saveData, loadData, removeData, requstPromise } from '../../../util/utils.js'
import request from '../../../api/request.js'

export async function goodsList(options) {
    const { dispatch } = store
    const res = await request.goodsList(options)
    console.log(res)
    if (res.data.results) {
        dispatch({
            type: ActionTypes.guestGoodsList,
            data: res.data
        })
    }

    return requstPromise(res)

}
